package com.air.designmodel.fifteen.proxy;


/**
 * 静态代理,代理类
 *
 * @author shent
 */
public class RealSubjectProxy implements Subject {
    private Subject realSubject;

    public RealSubjectProxy(Subject realSubject) {
        this.realSubject = realSubject;
    }

    @Override
    public void rent() {
        System.out.println("RealSubjectProxy do rent before");
        realSubject.rent();
        System.out.println("RealSubjectProxy do rent after");
    }

    @Override
    public void hello(String str) {
        System.out.println("RealSubjectProxy do hello before");
        realSubject.hello(str);
        System.out.println("RealSubjectProxy do hello after");
    }
}
